package com.info33.platform.system.controller;

import com.info33.platform.common.mvc.controller.BaseController;
import com.info33.platform.system.entity.SysDeptPost;
import com.info33.platform.system.service.SysDeptPostService;
import com.info33.platform.system.vo.SysDeptPostVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author admin
 */
@RestController
@RequestMapping("/SysDeptPost")
@Api(tags = "系统 - 用户部门岗位")
public class SysDeptPostController extends BaseController<SysDeptPostService, SysDeptPost> {

    private final SysDeptPostService sysDeptPostService;

    @Autowired
    public SysDeptPostController(SysDeptPostService sysDeptPostService) {
        super(sysDeptPostService);
        this.sysDeptPostService = sysDeptPostService;
    }

    @GetMapping(value = "/info/{uid}")
    @ApiOperation(value = "pc - 获取某用户部门岗位信息")
    public List<SysDeptPostVO> userInfo(
            @PathVariable(value = "uid") Long uid) {
        return sysDeptPostService.userInfo(uid, getCurrentUser());
    }

}